package Model;

import java.util.ArrayList;
import java.util.Iterator;

public class ListGesture {
	private String type;
	private ArrayList<String> listRoles;
	private ArrayList<String> listDescription;
	private ArrayList<Gesture> listGest;
	
	public ListGesture(String t){
		type = t;
		listRoles = new ArrayList<String>();
		listDescription = new ArrayList<String>();
		listGest= new ArrayList<Gesture>();
		
		//Si liste des gestes pour la video
		if(type.equals("Video")){
			listGest.add(0,new Gesture(0,"/gesture/push-button2.png",
					"/static_hand",false,"pause_resume","Pause / Resume a video",
					"<html><b>Description :</b> Keep your hand static during 3 seconds</html>"));
			listGest.add(1,new Gesture(1,"/gesture/pinch2.png",
					"/hand_up",true,"pause_resume","Pause / Resume a video",
					"<html><b>Description :</b> Put your hands up slowly</html>"));

			listRoles.add("pause_resume");
			
			listDescription.add("Pause / Resume a video");
			
		}else if(type.equals("Picture")){
			listGest.add(0,new Gesture(0,"/gesture/hands-horizontal-spread.png",
					"/hand_away",true,"zoom","Zoom in a picture",
					"<html><b>Description :</b> Spread your hands</html>"));
			listGest.add(1,new Gesture(1,"/gesture/hands-howizontal-pinch.png",
					"/hand_approach",true,"unzoom","Zoom out a picture",
					"<html><b>Description :</b> Approach your hands</html>"));
			
			listRoles.add("zoom");
			listRoles.add("unzoom");
			
			listDescription.add("Zoom in a picture");
			listDescription.add("Zoom out a picture");
			
		}else if(type.equals("Text")){
			
		}
		

	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public ArrayList<String> getListRoles() {
		return listRoles;
	}

	public void setListRoles(ArrayList<String> listRoles) {
		this.listRoles = listRoles;
	}

	public ArrayList<Gesture> getListGest() {
		return listGest;
	}

	public void setListGest(ArrayList<Gesture> listGest) {
		this.listGest = listGest;
	}

	public int getSelectedForRole(String role){
		Iterator<Gesture> itr = this.listGest.iterator();
	    while (itr.hasNext()) { 
	    	Gesture g = itr.next();
	    	
	    	if(g.getRole().equals(role) && g.isSelected()){
	    		return g.getNumGest();
	    	}
	    }
	    return -1;
	}

	public ArrayList<String> getListDescription() {
		return listDescription;
	}

	public void setListDescription(ArrayList<String> listDescription) {
		this.listDescription = listDescription;
	}
	
}
